home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
misc_pto
/
899
/
899modex.pro
< prev
next >
Wrap
Text File
|
1990-03-18
|
5KB
|
138 lines
project "899"
include "899glob.pro"
% 899MODEX.PRO -- Modifies or defines current information
% Uses window #20, 21
% Globals contained in this file::
% modspecs
CONSTANTS
ESTR = "Use cursors to move, Ctrl-Bksp to delete line, F10 when done"
DATABASE - modex
determ oldinf(gsList,gs,gsList,gs,gs,gs,gs,gsList)
PREDICATES
domod
showdef
pmodex(gs)
vernonull(gs,gs)
CLAUSES
modspecs(label(Cats,Lab,Addr,City,State,Zip,Phone,Comments),
label(Ncats,NLab,NAddr,NCity,NState,NZip,NPhone,NComments)) :-
makewindow(21,white,white," Current Data Specs ",6,0,18,79),
makewindow(20,white,white," Modification Interface ",0,0,6,79),
assert(oldinf(Cats,Lab,Addr,City,State,Zip,Phone,Comments),modex),
showdef,
domod,
retract(oldinf(Ncats,Nlab,Naddr,NCity,NState,NZip,NPhone,NComments),modex),
removewindow, removewindow.
domod :-
getbacktrack(Btop), % Get this to set up the following
Tit = "Use cursors to select label section,\17\217 selects ",
repeat,
Choices = ["RECORD LABEL","CATEGORIES","ADDRESS INFO","CITY",
"STATE","ZIP","PHONE","COMMENTS","DONE -- SAVE INFORMATION"],
show_get(Choices,Choice,Tit),
clearwindow, cursor(0,0),
pmodex(Choice),
showdef,
Choice = "DONE -- SAVE INFORMATION", !,
cutbacktrack(Btop).
pmodex("RECORD LABEL") :- !, % LAB
retract(oldinf(Cats,_,Addr,City,State,Zip,Phone,Comments),modex),
nl,
write("Enter new label name --> "),
readln(NLab),
assert(oldinf(Cats,NLab,Addr,City,State,Zip,Phone,Comments),modex).
pmodex("CATEGORIES") :- !, % CATS
getMusicTypes(AllTypes),
getbacktrack(Btop),
Tit = "Use cursors to select category,\17\217 selects,ESC=New Category ",
repeat,
retract(oldinf(Cats,Lab,Addr,City,State,Zip,Phone,Comments),modex),
clearwindow, cursor(0,0),
show_get(AllTypes,SelectType,Tit),
vernonull(SelectType,ChosenType),
Ncats = [ChosenType|Cats],
assert(oldinf(NCats,Lab,Addr,City,State,Zip,Phone,Comments),modex),
showdef,
write("Add more categories to this label (Y/N)? "),
not(askyn), % A NO continues
cutbacktrack(Btop).
pmodex("ADDRESS INFO") :- % Addr ( non exitisting )
oldinf(_,_,[],_,_,_,_,_),
edit_setup([""],estr),
edit_descr, !, % Edit the thing
edit_setdown(Naddr), % New address list
retract(oldinf(Cats,Lab,_,City,State,Zip,Phone,Comments),modex),
assert(oldinf(Cats,Lab,NAddr,City,State,Zip,Phone,Comments),modex).
pmodex("ADDRESS INFO") :- !, % Addr Existing
retract(oldinf(Cats,Lab,Addr,City,State,Zip,Phone,Comments),modex),
edit_setup(Addr,estr),
edit_descr, !, % Edit the thing
edit_setdown(Naddr), % New address list
assert(oldinf(Cats,Lab,NAddr,City,State,Zip,Phone,Comments),modex).
pmodex("CITY") :- !, % City
retract(oldinf(Cats,Lab,Addr,_,State,Zip,Phone,Comments),modex),
write("Enter new city --> "),
readln(NCity),
assert(oldinf(Cats,Lab,Addr,NCity,State,Zip,Phone,Comments),modex).
pmodex("STATE") :- !, % State
retract(oldinf(Cats,Lab,Addr,City,_,Zip,Phone,Comments),modex),
write("Enter new state --> "),
readln(NState),
assert(oldinf(Cats,Lab,Addr,City,NState,Zip,Phone,Comments),modex).
pmodex("ZIP") :- !, % Zip
retract(oldinf(Cats,Lab,Addr,City,State,_,Phone,Comments),modex),
write("Enter new Zip Code --> "),
readln(NZip),
assert(oldinf(Cats,Lab,Addr,City,State,NZip,Phone,Comments),modex).
pmodex("PHONE") :- !, % Phone
retract(oldinf(Cats,Lab,Addr,City,State,Zip,_,Comments),modex),
write("Enter new Phone --> "),
readln(NPhone),
assert(oldinf(Cats,Lab,Addr,City,State,Zip,NPhone,Comments),modex).
pmodex("COMMENTS") :- % Comments non existing
oldinf(_,_,_,_,_,_,_,[]),
edit_setup([""],estr),
edit_descr, !, % Edit the thing
edit_setdown(NComments), % New comment
retract(oldinf(Cats,Lab,Addr,City,State,Zip,Phone,_),modex),
assert(oldinf(Cats,Lab,Addr,City,State,Zip,Phone,NComments),modex).
pmodex("COMMENTS") :- !, % Comments existing
retract(oldinf(Cats,Lab,Addr,City,State,Zip,Phone,Comments),modex),
edit_setup(Comments,estr),
edit_descr, !, % Edit the thing
edit_setdown(NComments), % New address list
assert(oldinf(Cats,Lab,Addr,City,State,Zip,Phone,NComments),modex).
pmodex(_).
vernonull("",NewType) :- %
write("New Category name --> "),
cursor(CurrX,CurrY),
readln(NewCat),
cursor(CurrX,CurrY),
upper_lower(NewType,NewCat),
write(NewType), nl,
getMusicTypes(CurrList),
not(sameMusicCategory(NewType,CurrList)), !,
assertz(category(NewType)).
vernonull(X,X).
showdef :-
shiftwindow(21),
clearwindow,
oldinf(Cats,Lab,Addr,City,State,Zip,Phone,Comments),
write("RECORD LABEL : '",Lab,"'\n"),
write("ADDRESS INFO : ",Addr,'\n'),
write("C, S Z : ",City,' ',State," ",Zip,'\n'),
write("PHONE : ",Phone,'\n'),
write("CATEGORIES --\n"),
writelist(Cats,5),
write("COMMENTS --\n"),
writelist(Comments,0),
shiftwindow(20).